package com.higgins.eventtracking.client.health.settings;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.higgins.eventtracking.client.EventTrackingService;
import com.higgins.eventtracking.client.EventTrackingServiceAsync;
import com.higgins.eventtracking.client.dto.HealthAlertDTO;
import com.higgins.eventtracking.client.health.components.GenericChartPanel;
import com.higgins.eventtracking.client.health.components.GenericTabInterface;
import com.higgins.eventtracking.client.health.components.HealthAlertColumns;
import com.higgins.eventtracking.client.health.components.HealthAlertTable;

public class AlertsTab extends ScrollPanel		implements GenericTabInterface	{
	private final EventTrackingServiceAsync greetingService = GWT
			.create(EventTrackingService.class);
	VerticalPanel verticalPanel = new VerticalPanel();
	
	private boolean firstRun = true;
	private Integer tabIndex = null;
	private String tabTitle = null;
	
	@Override
	public Integer getTabIndex() {
		return tabIndex;
	}
	@Override
	public void setTabIndex(Integer index) {
		this.tabIndex = index;
	}
	@Override
	public String getTabTitle()	{
		return tabTitle;
	}
	@Override
	public void setTabTitle(String tabTitle)	{
		this.tabTitle = tabTitle;
	}

	public AlertsTab()	{
	}
	
	public void update()	{
		if (firstRun)	
			initialise();
		
	}
	
	public void initialise()	{
		firstRun = false;
		HealthAlertColumns columns = new HealthAlertColumns();
		HealthAlertTable table = new HealthAlertTable(columns);
		verticalPanel.add(table);
		add(verticalPanel);
		setHeight("50em");
//		setWidth("100em");
	}
	@Override
	public void addChartPanel(GenericChartPanel chartPanel) {
		// TODO Auto-generated method stub
		
	}
}
